import React, {Component} from 'react';
import '../css/maizuo.css'

class Tabbar extends Component {
    render() {
        return (<div>
            <ul>
                {this.props.list.map((item, index) =>
                    <li onClick={() => this.props.changeIndex(index)}
                        className={this.props.currentIndex === index ? 'active' : null}
                        key={item.id}>
                        {item.name}
                    </li>
                )}
            </ul>
        </div>);
    }
}

export default Tabbar;